﻿using AJWPFAdmin.Core.CommonEntity;
using AJWPFAdmin.Core.Enums;
using AJWPFAdmin.Core.Excel;
using Microsoft.EntityFrameworkCore;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace AJWPFAdmin.Core.Models.EF.Tables
{
    /// <summary>
    /// 运输台账记录表
    /// </summary>
    [Comment("运输台账记录表")]
    public partial class ShippingRecord : CommonTableEntity
    {
        #region 车辆信息字段

        /// <summary>
        /// 车牌号
        /// </summary>
        [Comment("车牌号")]
        [Required]
        [MaxLength(120)]
        [AJExportField(ColumnName = "车牌号")]
        public string CarNo { get; set; }

        /// <summary>
        /// 卡号,用于读卡器识别车牌
        /// </summary>
        [Comment("卡号,用于读卡器识别车牌")]
        [MaxLength(100)]
        [AJExportField(ColumnName = "卡号")]
        public string CardNo { get; set; }

        /// <summary>
        /// 车牌号颜色
        /// </summary>
        [Comment("车牌号颜色")]
        [AJExportField(ColumnName = "车牌号颜色")]
        public CarPlateColor PlateColor { get; set; }

        /// <summary>
        /// 车辆类型Id, CarType.Id
        /// </summary>
        [Comment("车辆类型Id")]
        public long TypeId { get; set; }

        /// <summary>
        /// 车辆类型名称,  CarType.Name
        /// </summary>
        [Comment("车辆类型名称")]
        [MaxLength(50)]
        [AJExportField(ColumnName = "车辆类型")]
        public string TypeName { get; set; }

        /// <summary>
        /// 货车车辆类型编码, SystemDictionary.Code
        /// </summary>
        [Comment("货车车辆类型编码")]
        [MaxLength(20)]
        public string TruckTypeCode { get; set; }

        /// <summary>
        /// 货车车辆类型名称,  SystemDictionary.Name
        /// </summary>
        [Comment("货车车辆类型名称")]
        [MaxLength(20)]
        [AJExportField(ColumnName = "货车车辆类型")]
        public string TruckTypeName { get; set; }

        /// <summary>
        /// 车辆品牌型号
        /// </summary>
        [Comment("车辆品牌型号")]
        [MaxLength(50)]
        [AJExportField(ColumnName = "车辆品牌型号")]
        public string CarBrandModel { get; set; }

        /// <summary>
        /// 燃料类型编码, SystemDictionary.Code
        /// </summary>
        [Comment("燃料类型编码")]
        [MaxLength(20)]
        public string FuelTypeCode { get; set; }

        /// <summary>
        /// 燃料类型名称,  SystemDictionary.Name
        /// </summary>
        [Comment("燃料类型名称")]
        [MaxLength(20)]
        [AJExportField(ColumnName = "燃料类型")]
        public string FuelTypeName { get; set; }

        /// <summary>
        /// 排放标准
        /// </summary>
        [Comment("排放标准")]
        [AJExportField(ColumnName = "排放标准")]
        public EmissionStandard EmissionStandard { get; set; }

        /// <summary>
        /// 联网状态
        /// </summary>
        [Comment("联网状态")]
        [AJExportField(ColumnName = "联网状态")]
        public bool NetworkingStatus { get; set; }

        /// <summary>
        /// 使用性质编号
        /// </summary>
        [Comment("使用性质编号")]
        [Display(Name = "使用性质编号")]
        [MaxLength(20)]
        public string UsageDescCode { get; set; }

        /// <summary>
        /// 使用性质名称
        /// </summary>
        [Comment("使用性质类型名称")]
        [Display(Name = "使用性质名称")]
        [MaxLength(100)]
        [AJExportField(ColumnName = "使用性质")]
        public string UsageDescription { get; set; }

        /// <summary>
        /// 发动机号
        /// </summary>
        [Comment("发动机号")]
        [MaxLength(50)]
        [AJExportField(ColumnName = "发动机号")]
        public string EngineNo { get; set; }

        /// <summary>
        /// 发动机型号
        /// </summary>
        [Comment("发动机型号")]
        [AJExportField(ColumnName = "发动机型号")]
        public string EngineModel { get; set; }

        /// <summary>
        /// 发动机生产厂
        /// </summary>
        [Comment("发动机生产厂")]
        [AJExportField(ColumnName = "发动机生产厂")]
        public string EngineManufacturer { get; set; }

        /// <summary>
        /// 机械环保信息标签
        /// </summary>
        [Comment("机械环保信息标签")]
        [AJExportField(ColumnName = "机械环保信息标签", IsImage = true)]
        public string MachineEnvProtectionLabel { get; set; }

        /// <summary>
        /// 排放阶段图片Json数组文件路径
        /// </summary>
        [Comment("排放阶段图片Json数组文件路径")]
        [Display(Name = "排放阶段图片")]
        [AJExportField(ColumnName = "排放阶段图片", IsImage = true)]
        public string EmissionStandardImages { get; set; }

        /// <summary>
        /// 铭牌
        /// </summary>
        [Comment("铭牌")]
        [AJExportField(ColumnName = "铭牌", IsImage = true)]
        public string Nameplate { get; set; }

        /// <summary>
        /// 发动机铭牌
        /// </summary>
        [Comment("发动机铭牌")]
        [AJExportField(ColumnName = "发动机铭牌", IsImage = true)]
        public string EngineNameplate { get; set; }

        /// <summary>
        /// VIN
        /// </summary>
        [MaxLength(50)]
        [Comment("VIN")]
        [AJExportField(ColumnName = "VIN")]
        public string VIN { get; set; }

        /// <summary>
        /// 注册日期
        /// </summary>
        [Comment("注册日期")]
        [AJExportField(ColumnName = "注册日期")]
        public DateTime? RegDate { get; set; }

        /// <summary>
        /// 车队名称
        /// </summary>
        [Comment("车队名称")]
        [MaxLength(50)]
        [AJExportField(ColumnName = "车队名称")]
        public string TeamName { get; set; }

        /// <summary>
        /// 行驶证图片路径json数组字符串
        /// </summary>
        [Comment("行驶证图片路径json数组字符串")]
        [AJExportField(ColumnName = "行驶证", IsImage = true)]
        public string VehicleLicense { get; set; }

        /// <summary>
        /// 随车清单路径json数组字符串
        /// </summary>
        [Comment("随车清单路径json数组字符串")]
        [AJExportField(ColumnName = "随车清单", IsImage = true)]
        public string Attachments { get; set; }

        /// <summary>
        /// 环保登记编码
        /// </summary>
        [MaxLength(100)]
        [Comment("环保登记编码")]
        [AJExportField(ColumnName = "环保登记编码")]
        public string EnvRegCode { get; set; }

        /// <summary>
        /// 生产日期
        /// </summary>
        [Comment("生产日期")]
        [AJExportField(ColumnName = "生产日期")]
        public DateTime? ProductionDate { get; set; }

        /// <summary>
        /// 机械生产日期
        /// </summary>
        [Comment("机械生产日期")]
        [AJExportField(ColumnName = "机械生产日期")]
        public DateTime? MechanicalProdDate { get; set; }

        /// <summary>
        /// 机械种类
        /// </summary>
        [Comment("机械种类")]
        [AJExportField(ColumnName = "机械种类")]
        public MachineType? MachineType { get; set; }

        /// <summary>
        /// 机械型号
        /// </summary>
        [Comment("机械型号")]
        [AJExportField(ColumnName = "机械型号")]
        public string MachineModel { get; set; }

        /// <summary>
        /// 机械环保代码(产品识别码)PIN
        /// </summary>
        [MaxLength(100)]
        [Comment("机械环保代码(产品识别码)PIN")]
        [AJExportField(ColumnName = "PIN")]
        public string PIN { get; set; }

        /// <summary>
        /// 车辆所有人(单位)
        /// </summary>
        [Comment("车辆所有人(单位)")]
        [MaxLength(128)]
        [AJExportField(ColumnName = "车辆所有人(单位)")]
        public string Owner { get; set; }

        /// <summary>
        /// 车辆图片路径json数组字符串
        /// </summary>
        [Comment("车辆图片路径json数组字符串")]
        [Display(Name = "车辆图片")]
        [AJExportField(ColumnName = "车辆图片", IsImage = true)]
        public string CarImage { get; set; }

        /// <summary>
        /// 核定载重质量
        /// </summary>
        [Comment("核定载重质量")]
        [Display(Name = "核定载重质量")]
        [AJExportField(ColumnName = "核定载重质量")]
        [StringLength(20)]
        [MaxLength(20, ErrorMessage = "{0}超长:{1}")]
        public string VerifiedLoadWeight { get; set; }

        /// <summary>
        /// 准牵引总质量
        /// </summary>
        [Comment("准牵引总质量")]
        [Display(Name = "准牵引总质量")]
        [AJExportField(ColumnName = "准牵引总质量")]
        [StringLength(20)]
        [MaxLength(20, ErrorMessage = "{0}超长:{1}")]
        public string PermittedTowingWeight { get; set; }

        #endregion

        /// <summary>
        /// 进厂运输货物名称
        /// </summary>
        [Comment("进厂运输货物名称")]
        [MaxLength(200)]
        [StringLength(200, ErrorMessage = "{0}超长:{1}")]
        [AJExportField(ColumnName = "进厂运输货物名称")]
        public string InGoodsName { get; set; }

        /// <summary>
        /// 进厂运输量
        /// </summary>
        [Comment("进厂运输量")]
        [Precision(18, 2)]
        [AJExportField(ColumnName = "进厂运输量")]
        public decimal InGoodsVolume { get; set; }

        /// <summary>
        /// 出厂运输货物名称
        /// </summary>
        [Comment("出厂运输货物名称")]
        [MaxLength(200)]
        [StringLength(200, ErrorMessage = "{0}超长:{1}")]
        [AJExportField(ColumnName = "出厂运输货物名称")]
        public string OutGoodsName { get; set; }

        /// <summary>
        /// 出厂运输量
        /// </summary>
        [Comment("出厂运输量")]
        [Precision(18, 2)]
        [AJExportField(ColumnName = "出厂运输量")]
        public decimal OutGoodsVolume { get; set; }

        /// <summary>
        /// 进厂时间
        /// </summary>
        [Comment("进厂时间")]
        [Display(Name = "进厂时间")]
        [AJExportField(ColumnName = "进厂时间")]
        public DateTime? ShipStartDate { get; set; }

        /// <summary>
        /// 出厂时间 
        /// </summary>
        [Comment("出厂时间")]
        [Display(Name = "出厂时间")]
        [AJExportField(ColumnName = "出厂时间")]
        public DateTime? ShipEndDate { get; set; }

        /// <summary>
        /// 进厂岗亭id/入口id
        /// </summary>
        [Comment("进厂岗亭/入口id")]
        public long WatchhouseId { get; set; }

        /// <summary>
        /// 进厂岗亭/入口编号
        /// </summary>
        [Comment("进厂岗亭/入口编号")]
        [MaxLength(50)]
        [StringLength(50, ErrorMessage = "{0}超长:{1}")]
        [AJExportField(ColumnName = "入口编号")]
        public string WatchhouseCode { get; set; }

        /// <summary>
        /// 进厂岗亭名称/入口名称
        /// </summary>
        [Comment("进厂岗亭/入口名称")]
        [MaxLength(50)]
        [AJExportField(ColumnName = "入口名称")]
        public string WatchhouseName { get; set; }


        /// <summary>
        /// 进厂岗亭id/出口id
        /// </summary>
        [Comment("进厂岗亭/出口id")]
        public long? OutWatchhouseId { get; set; }

        /// <summary>
        /// 进厂岗亭/出口编号
        /// </summary>
        [Comment("进厂岗亭/出口编号")]
        [MaxLength(50)]
        [StringLength(50, ErrorMessage = "{0}超长:{1}")]
        [AJExportField(ColumnName = "出口编号")]
        public string OutWatchhouseCode { get; set; }

        /// <summary>
        /// 进厂岗亭名称/出口名称
        /// </summary>
        [Comment("进厂岗亭/出口名称")]
        [MaxLength(50)]
        [AJExportField(ColumnName = "出口名称")]
        public string OutWatchhouseName { get; set; }

        /// <summary>
        /// 进厂通道(道闸)id
        /// </summary>
        [Comment("进厂通道(道闸)id")]
        public long PassagewayId { get; set; }

        /// <summary>
        /// 进厂通道(道闸)编号
        /// </summary>
        [Comment("进厂通道(道闸)编号")]
        [MaxLength(50)]
        [StringLength(50, ErrorMessage = "{0}超长:{1}")]
        [AJExportField(ColumnName = "进口道闸编号")]
        public string PassagewayCode { get; set; }

        /// <summary>
        /// 进厂通道(道闸)名称
        /// </summary>
        [Comment("进厂通道(道闸)名称")]
        [MaxLength(50)]
        [AJExportField(ColumnName = "进口道闸名称")]
        public string PassagewayName { get; set; }

        /// <summary>
        /// 出厂通道(道闸)id
        /// </summary>
        [Comment("出厂通道(道闸)id")]
        public long? OutPassagewayId { get; set; }

        /// <summary>
        /// 出厂通道(道闸)编号
        /// </summary>
        [Comment("出厂通道(道闸)编号")]
        [MaxLength(50)]
        [StringLength(50, ErrorMessage = "{0}超长:{1}")]
        [AJExportField(ColumnName = "出口道闸编号")]
        public string OutPassagewayCode { get; set; }

        /// <summary>
        /// 出厂通道(道闸)名称
        /// </summary>
        [Comment("出厂通道(道闸)名称")]
        [MaxLength(50)]
        [AJExportField(ColumnName = "出口道闸名称")]
        public string OutPassagewayName { get; set; }

        /// <summary>
        /// 方向
        /// </summary>
        [Comment("方向")]
        public PassagewayDirection Direction { get; set; }

        /// <summary>
        /// 入口关联设备Id
        /// </summary>
        [Comment("入口关联设备Id")]
        public long DeviceId { get; set; }

        /// <summary>
        /// 入口关联设备编号
        /// </summary>
        [Comment("入口关联设备编号")]
        [MaxLength(50)]
        public string DeviceCode { get; set; }

        /// <summary>
        /// 出口关联设备Id
        /// </summary>
        [Comment("出口关联设备Id")]
        public long? OutDeviceId { get; set; }

        /// <summary>
        /// 出口关联设备编号
        /// </summary>
        [Comment("出口关联设备编号")]
        [MaxLength(50)]
        public string OutDeviceCode { get; set; }

        /// <summary>
        /// 进厂抓拍图文件路径
        /// </summary>
        [Comment("进厂抓拍图文件路径")]
        [AJExportField(ColumnName = "进厂图", IsImage = true)]
        public string InCaptureFile { get; set; }

        /// <summary>
        /// 出厂监控抓拍图文件路径
        /// </summary>
        [Comment("出厂监控抓拍图文件路径")]
        [AJExportField(ColumnName = "出厂图",IsImage = true)]
        public string OutCaptureFile { get; set; }

        /// <summary>
        /// 是否自动开闸,车牌识别后会赋值
        /// </summary>
        [Comment("是否是自动开闸")]
        public bool AutoPass { get; set; }

        /// <summary>
        /// 通道关联的仓库id
        /// </summary>
        [Comment("通道关联的仓库id")]
        public long? WarehouseId { get; set; }

        /// <summary>
        /// 通道关联的仓库名称
        /// </summary>
        [Comment("通道关联的仓库名称")]
        [AJExportField(ColumnName = "仓库名称")]
        public string WarehouseName { get; set; }

        /// <summary>
        /// 记录序号, 每更新/上传一次 +1 
        /// </summary>
        [Comment("记录序号, 每更新/上传一次 +1")]
        public byte RecordNum { get; set; }

        /// <summary>
        /// 物资记录序号, 每更新/上传一次 +1 
        /// </summary>
        [Comment("物资记录序号, 每更新/上传一次 +1")]
        public byte GoodsNum { get; set; }

        /// <summary>
        /// 货运单位
        /// </summary>
        [Comment("货运单位")]
        [AJExportField(ColumnName = "货运单位")]
        public FreightUnit FreightUnit { get; set; }

        /// <summary>
        /// 是否已同步
        /// </summary>
        [Comment("是否已同步")]
        public bool Synchronized { get; set; }

        /// <summary>
        /// 同步结果,备用
        /// </summary>
        [Comment("同步结果,备用")]
        [Display(Name = "同步结果")]
        public string SyncResult { get; set; }

        /// <summary>
        /// 派车单号/票号/单号等
        /// </summary>
        [Comment("派车单号/票号/单号等")]
        [MaxLength(120)]
        [AJExportField(ColumnName = "派车单号")]
        public string TicketCode { get; set; }

        /// <summary>
        /// 发货单位
        /// </summary>
        [Comment("发货单位")]
        [MaxLength(120)]
        [AJExportField(ColumnName = "发货单位")]
        public string Sender { get; set; }

        /// <summary>
        /// 收货单位
        /// </summary>
        [Comment("收货单位")]
        [MaxLength(120)]
        [AJExportField(ColumnName = "收货单位")]
        public string Receiver { get; set; }

        /// <summary>
        /// 收发标记
        /// </summary>
        [Comment("收发标记")]
        [MaxLength(120)]
        [AJExportField(ColumnName = "收发标记")]
        public string SendOrReceiveFlag { get; set; }

        /// <summary>
        /// 进厂物资类型
        /// </summary>
        [Comment("进厂物资类型")]
        [MaxLength(120)]
        [AJExportField(ColumnName = "进厂物资类型")]
        public string InGoodsType { get; set; }

        /// <summary>
        /// 出厂物资类型
        /// </summary>
        [Comment("出厂物资类型")]
        [MaxLength(120)]
        [AJExportField(ColumnName = "出厂物资类型")]
        public string OutGoodsType { get; set; }

        /// <summary>
        /// 进厂录制视频文件路径
        /// </summary>
        [Comment("进厂录制视频文件路径")]
        [AJExportField(ColumnName = "进厂视频")]
        public string InVideoCaptureFile { get; set; }

        /// <summary>
        /// 出厂录制视频文件路径
        /// </summary>
        [Comment("出厂录制视频文件路径")]
        [AJExportField(ColumnName = "出厂视频")]
        public string OutVideoCaptureFile { get; set; }

        /// <summary>
        /// 进厂物资是否大宗
        /// </summary>
        [Comment("进厂物资是否大宗")]
        [MaxLength(120)]
        [AJExportField(ColumnName = "进厂物资是否大宗")]
        public bool? InGoodsIsBulkCargo { get; set; }

        /// <summary>
        /// 出厂物资是否大宗
        /// </summary>
        [Comment("出厂物资是否大宗")]
        [AJExportField(ColumnName = "出厂物资是否大宗")]
        public bool? OutGoodsIsBulkCargo { get; set; }
        /// <summary>
        /// 是否企业自有车辆
        /// </summary>
        [Comment("是否企业自有车辆")]
        [Display(Name = "是否企业自有车辆")]
        [AJExportField(ColumnName = "是否企业自有车辆")]
        [StringLength(10)]
        [MaxLength(10, ErrorMessage = "{0}超长:{1}")]
        public string IsOwnedByCompany { set; get; }
    }
}
